#pragma once

///////////////////////////////////////////////////////////////////////////
//																		 //
//	Author:		Michael Mozdzierz										 //
//	Date:		12/06/2014												 //
//	Purpose:	Make a sound effect object that encapsulates DirectX 	 //
//				audio into a single function							 //
//																		 //
///////////////////////////////////////////////////////////////////////////

#include "ISoundElement.h"
#include <vector>
#include <fmod.hpp>

using namespace std;

class SoundEffect2D : public ISoundElement
{
	friend class AudioManager;

	FMOD::Sound* sound;

	FMOD::Channel* channel;


	unsigned int flags;

	static const float sampleSize;	
	
	virtual FMOD::Channel* getChannel(void) const override { return channel; }

	virtual FMOD::Sound* getSound(void) const override { return sound; }

	virtual void setChannel(FMOD::Channel* value) override { channel = value; }

	virtual void setSound(FMOD::Sound* value) override { sound = value; }

	virtual bool getIsPlaying(void) const override { return false; }

	virtual bool getIsLooped(void) const { return false; }

	virtual void setIsLooped(bool value) override;

	SoundEffect2D(void);

	float volume = 1.f;

	bool isPlaying = false;
public:
	virtual ~SoundEffect2D(void);

	virtual void setVolume(float value) { volume = value; }

	virtual float getVolume(void) const { return volume; }

	// updates the sound
	virtual void Update(void) override;
};